-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve][admin] Allow creating builtin functions in pulsar-admin CLI #15671
Conversation
pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/CmdFunctionsTest.java
Show resolved
Hide resolved
81052b0
to
a9597a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I had not understood well the feature. As discussed offline now the feature is very clear to me and works well.
Supporting to not set the classname can be done as a follow up step
/pulsarbot rerun-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a9597a9
to
f86f277
Compare
* Parse function userConfig to Map<String, Object> (apache#15669) Currently only {userConfig: {some-key: some-value}} is allowed which is limiting With this change any JSON compatible object is allowed. Eg: {userConfig: {some-key: [value1, value2]}} * Allow creating builtin functions in pulsar-admin CLI (apache#15671) * [fix][admin] Fix check on create function class name (apache#15700) The check was done for PYTHON or JAVA runtime but the runtime is not inferred in the admin CLI. The fix is to do the check if a jar or py is provided instead * [improve][function] Get function class name from the NAR when using built-in functions (apache#15693) * Get function class name from the NAR manifest when using built-in functions * Exclude pulsar-io.yaml from examples JAR * Build a NAR separately from the JAR for the function examples * Improve admin cli tes for built-in functions
Motivation
Currently creating a built-in function with argument
--jar builtin://my-built-in-function
is rejected with errorThe specified jar file does not exist
.This change allows to do it.
Modifications
Check if the jar starts with
builtin://
Verifying this change
This change added tests and can be verified as follows:
Run test
CmdFunctionsTest::testCreateFunctionWithBuiltinNar
Does this pull request potentially affect one of the following parts:
No
If
yes
was chosen, please highlight the changesDocumentation
Check the box below or label this PR directly.
Need to update docs?
doc-required
(Your PR needs to update docs and you will update later)
no-need-doc
trivial (or would need a full doc on builtin functions which is inexistant atm)
doc
(Your PR contains doc changes)
doc-added
(Docs have been already added)